<template>
  <div>
    <h3>添加用户 <span class="label label-default">add</span></h3>
    <br />
    <br />
    <div class="row">
      <div class="col-lg-3"></div>
      <div class="col-lg-6">
        <div class="input-group input-group-lg">
          <span class="input-group-addon" id="sizing-addon1">Uname</span>
          <input
            type="text"
            class="form-control"
            placeholder="Uname"
            aria-describedby="sizing-addon1"
            v-model="uname"
          />
        </div>
      </div>
      <div class="col-lg-3"></div>
    </div>
    <br />
    <div class="row">
      <div class="col-lg-3"></div>
      <div class="col-lg-6">
        <div class="input-group input-group-lg">
          <span class="input-group-addon" id="sizing-addon1">Upassword</span>
          <input
            type="text"
            class="form-control"
            placeholder="Upassword"
            aria-describedby="sizing-addon1"
            v-model="upassword"
          />
        </div>
      </div>
      <div class="col-lg-3"></div>
    </div>
    <br />
    <div class="row">
      <div class="col-lg-3"></div>
      <div class="col-lg-6"></div>
      <div class="col-lg-3"></div>
    </div>
    <div class="btn-group" role="group" aria-label="...">
      <br />
      <button type="button" class="btn btn-default" @click="add">提交</button>
      <button type="button" class="btn btn-default" @click="back">
        返回管理员界面
      </button>
    </div>
  </div>
</template>

<script>
import { requests } from "../../request/request";
import {addAxios} from "../../request/api"
export default {
  name: "add",
  data() {
    return {
      uid: "001",
      uname: "11",
      upassword: 123456,
    };
  },
  computed: {
    message() {
      return [this.uid, this.uname, this.upassword, this.identity];
    },
 
  },
  methods: {
    add() {
      if (this.uid == 0 || this.uname == 0 || this.upassword == 0) {
        alert("请输入完整输入框");
      } else {
        let json ={
          "uname":this.uname,
          "upassword":this.upassword
        }
        let thisa=this
          addAxios(json,thisa)
      }
    },
    back() {
      window.history.go(-1);
    },
  },
};
</script>

<style>
</style>